﻿@model Model.AppUserList
@{
    ViewBag.Title = "ProjectManage";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}
@using Model
<style type="text/css">
    #dlg table {
        width: 100%;
        border-collapse: collapse;
    }

        #dlg table tr {
            height: 35px;
        }

            #dlg table tr td input {
                height: 20px;
                line-height: 20px;
                width: 150px;
            }

            #dlg table tr td {
                border: 1px solid #ccc;
            }

                #dlg table tr td:first-child {
                    text-align: right;
                }
</style>
<style>
    .black_overlay {
        display: none;
        position: absolute;
        top: 0%;
        left: 0%;
        width: 100%;
        height: 100%;
        background-color: black;
        z-index: 1001;
        -moz-opacity: 0.8;
        opacity: .80;
        filter: alpha(opacity=80);
    }

    .white_content {
        display: none;
        position: absolute;
        top: 10%;
        left: 10%;
        width: 80%;
        height: 80%;
        border: 16px solid lightblue;
        background-color: white;
        z-index: 1002;
        overflow: auto;
    }

    .white_content_small {
        display: none;
        position: absolute;
        top: 20%;
        left: 30%;
        width: 40%;
        height: 50%;
        border: 16px solid lightblue;
        background-color: white;
        z-index: 1002;
        overflow: auto;
    }
</style>
@section JQscriptSection{
    <script type="text/javascript">
        $(document).ready(function () {
            InitGrid();
        });

        function InitGrid() {
            var ssystemID = $('#systemName').datebox('getValue');
            var sModularID = $('#modularName').datebox('getValue');
            queryParams = {
                systemID: ssystemID,
                modularID: sModularID
            }
            HandleData.InitDataGrid('dg', '/ProjectManage/InitJsonResult', 'toolbar', queryParams, 'PROJECTID', true);
        }
        HandleDom.ClassTriggerClick("icon-add", function () {
            HandleDialog.OpenDialogByAdd('dlg', '新增项目信息', function () {
                HandleData.ClearForm('location');
                HandleData.SetValueComboBox('ssystemName', "0");
                HandleData.SetValueComboBox('smodularName', "0");
                HandleData.SetValueComboBox('programName', "GIT");
                HandleData.SetValueComboBox('productName', "禅道");
            });
        });



        function saveData(isClose) {
            HandleRequest.submitForm('location', '@Url.Action("SaveData", "ProjectManage")', function (data) {
                eval('data=' + data);
                if (data.success == true) {
                    layer.alert('执行成功!', 9);
                    InitGrid();
                    HandleDialog.CloseDialog('dlg');
                } else {
                    layer.msg(data.msg, 1);
                }

            });
        }


    </script>
}

<body style="background-color: ButtonFace; font-size: 17px">
    <div class="easyui-panel" title="查询条件" style="height: 130px; padding: 5px; background: #fafafa; width: 1700px;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>系统名称:
                    </td>
                    <td>
                        <input id="systemName" class="easyui-combobox" name="systemName"  data-options="valueField:'SYSTEMID',textField:'SYSTEMNAME',url:'@Url.Action("GetOAFileSystemList", "BaseData", new { isDefault = true, defaultValue = "请选择系统" })',editable:false">
                    </td>
                    <td>模块名称:
                    </td>
                    <td>
                        <input id="modularName" class="easyui-combobox" name="modularName" style="width: 155px;" data-options="required:true,valueField:'MODULARID',textField:'MODULARNAME',url:'@Url.Action("GetOAFileModularList", "BaseData", new { isDefault = true, defaultValue = "请选择模块" })',editable:false">
                    </td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div style="min-height: 720px; width: 1700px;">
        <table id="dg" title="系统项目信息" style="min-height: 600px;">
            <thead>
                <tr>
                    <th data-options="field:'PROJECTID',width:30">ID</th>
                    <th data-options="field:'SYSTEMNAME',width:80">系统名称</th>
                    <th data-options="field:'MODULARNAME',width:80">模块名称</th>
                    <th data-options="field:'PROGRAMNAME',width:80">源码管理工具</th>
                    <th data-options="field:'PROGRAMURL',width:80">代码路径</th>
                    <th data-options="field:'PRODUCTNAME',width:80">项目管理工具</th>
                    <th data-options="field:'PRODUCTURL',width:100">项目管理路径</th>
                    <th data-options="field:'CREATEDATE',width:100,sortable:true,formatter:function(value, rowData, rowIndex){ return FormatData.formatDate(value);}">录入时间</th>
                    <th data-options="field:'USERNAME',width:50">创建人</th>

                </tr>
            </thead>
        </table>
    </div>
    <div id="dlg" class="easyui-dialog" style="width: 420px; height: 300px; top: 300px; left: 400px; padding: 2px"
        data-options="closed:true,buttons:'#dlg-buttons',modal:true">
        <form id="location" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <td>请选择系统:
                    </td>
                    <td>
                        <input id="ssystemName" class="easyui-combobox" name="ssystemName"  data-options="valueField:'SYSTEMID',textField:'SYSTEMNAME',url:'@Url.Action("GetOAFileSystemList", "BaseData", new { isDefault = true, defaultValue = "请选择系统" })',editable:false">
                    </td>

                </tr>
                <tr>
                    <td>请选择模块:
                    </td>
                    <td>
                        <input id="smodularName" class="easyui-combobox" name="smodularName"  data-options="valueField:'MODULARID',textField:'MODULARNAME',url:'@Url.Action("GetOAFileModularList", "BaseData", new { isDefault = true, defaultValue = "请选择模块" })',editable:false">
                    </td>

                </tr>
                <tr>
                    <td>源码管理工具:
                    </td>
                    <td>
                        <select id="programName" class="easyui-combobox" name="programName" style="width: 154px;">
                            <option value="GIT">GIT</option>
                            <option value="TFS">TFS</option>
                            <option value="SVN">SVN</option>
                            <option value="VSS">VSS</option>
                            <option value="其他">其他</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>代码路径:
                    </td>
                    <td>
                        <input id="programUrl" name="programUrl" class="easyui-validatebox" style="width: 154px" data-options="required:true" />
                    </td>

                </tr>
                <tr>
                    <td>项目管理工具:
                    </td>
                    <td>
                        <select id="productName" class="easyui-combobox" name="productName" style="width: 154px;">
                            <option value="禅道">禅道</option>
                            <option value="jira">jira</option>
                            <option value="其他">其他</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>代码路径:
                    </td>
                    <td>
                        <input id="productUrl" name="productUrl" class="easyui-validatebox" style="width: 154px" data-options="required:true" />
                    </td>

                </tr>
                <tr>
                    <td></td>
                    <td>
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="saveData(false)">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    @Html.Partial("~/Views/Shared/_PartialToolbar.cshtml", new Toolbar
{
    GridName = "dg",
    GridType = "datagrid",
    ToolbarName = "toolbar",
    FunctionModule = new Dictionary<string, List<FunctionModule>>()
    {
        {"Function",new List<FunctionModule>()
            {
              new FunctionModule(){Name = "Add",IsEnable =true },
              new FunctionModule(){Name = "Edit",IsEnable =false },
              new FunctionModule(){Name = "Remove",IsEnable =false },
              new FunctionModule(){Name = "Reload",IsEnable =false },
              new FunctionModule(){Name = "Collapse",IsEnable =false },
              new FunctionModule(){Name = "Exporter",IsEnable =false },
              new FunctionModule(){Name = "AllAdd",IsEnable =false },
              
              
            }
        }
    }
})

</body>

